<?php
namespace Home\Controller;
use Think\Controller;
class ExampleController extends Controller {
	public function example(){
		// banner:
		$banner=M('banner');
    	$bannerlist=$banner->select();
    	$this->assign('bannerlist',$bannerlist);

    	// 案例展示：
    	$example=M('example');
    	$exampleData=$example->where('type=1')->order('exampleDate desc')->limit(3)->select();
    	// var_dump($exampleData[0]['examplecontent']);
    	$this->assign('exampleData',$exampleData);
        $this->display();
    }

    public function getajax(){
		$type=$_POST['type'];
		$example=M('example');
		$data=$example->where('type='.$type)->order('exampleDate desc')->limit(3)->select();
		$this->ajaxReturn($data);
    }
}